/* eslint-disable import/extensions */
// eslint-disable-next-line import/no-unresolved
// eslint-disable-next-line import/extensions
// eslint-disable-next-line import/no-unresolved

// import { reduce } from 'lodash';
import { setProductPrice } from '~/common';

export const ACCESSORIES_COLUMNS = [
  { width: '60px', type: 'index', label: '序号', align: 'center' },
  {
    minWidth: '150',
    prop: 'snCode',
    label: '序列号',
    align: 'center',
    'show-overflow-tooltip': true
  },
  {
    minWidth: '150',
    prop: 'productCount',
    label: '数量',
    align: 'center',
    'show-overflow-tooltip': true
  },
  {
    width: '80',
    prop: 'ops',
    label: '操作',
    align: 'center'
  }
];
export const COLUMNS_PRODUCT = [
  { width: '60px', type: 'index', label: '序号', align: 'center' },
  {
    minWidth: '150',
    prop: 'factoryItemNum',
    label: '原厂产品编码',
    align: 'center',
    'show-overflow-tooltip': true
  },
  {
    minWidth: '150',
    prop: 'itemNum',
    label: '供应商产品编码',
    align: 'center',
    'show-overflow-tooltip': true
  },
  {
    minWidth: '250',
    prop: 'itemName',
    label: '产品名称',
    align: 'center',
    'show-overflow-tooltip': true
  },
  {
    'min-width': '100',
    prop: 'specs',
    label: '规格',
    align: 'center',
    'show-overflow-tooltip': true
  },
  {
    'min-width': '250',
    prop: 'manufacturerName',
    label: '生产厂家',
    align: 'center',
    'show-overflow-tooltip': true
  },
  {
    minWidth: '150',
    prop: 'productLineName',
    label: '产品线',
    align: 'center'
  },
  {
    minWidth: '130',
    prop: 'vendorLotNumber',
    label: '批号',
    align: 'center'
  },
  // {
  //   minWidth: '180',
  //   prop: 'primaryUnitOfMeasureName',
  //   label: '生产日期',
  //   align: 'center'
  // },
  {
    minWidth: '180',
    prop: 'expirationDate',
    label: '有效期至',
    align: 'center'
  },
  {
    minWidth: '180',
    prop: 'availableQuantity',
    label: '寄售库存量',
    align: 'center'
  },
  {
    minWidth: '180',
    prop: 'productCount',
    label: '消耗数量',
    align: 'center'
  },
  {
    minWidth: '230',
    prop: 'primaryUnitName',
    label: '单位'
    // align: 'center'
  },
  {
    width: '160',
    prop: 'price',
    label: '单价（元）',
    // align: 'center',
    formatter: row => setProductPrice(row.price)
  },
  {
    minWidth: '200',
    prop: 'amountOfMoney',
    label: '金额小计(元)',
    align: 'center'
  },
  {
    minWidth: '150',
    prop: 'opt',
    label: '操作',
    fixed: 'right',
    align: 'center'
  }
];
